package biolabs.core;

import biolabs.visual.Visualizable

/**
 * Base interface for all model objects of real biological objects.
 *
 * @author Tomas Mikula
 */
trait BioObject extends Visualizable {

	// check that the concrete class does not take type parameters,
	// otherwise issue a warning
	if(getClass().getTypeParameters().length != 0)
		Application.LOGGER.warning(getClass() +
				" has unresolved type parameters." +
				" May cause problems with visualization.")


	/**
	 * Causes this bio-object to advance in time as if the given period of
	 * time ({@code toTime-fromTime} simulation steps) has passed.
	 * The BioLabs runtime guarantees that {@code toTime > fromTime},
	 * thus the implementations do not need to check this condition.
	 * @param fromTime the number of steps passed since the simulation start
	 * @param toTime the simulation step at which this bio-object should stop
	 * @param ctx context of the execution. Will be used for submitting tasks
	 * to be executed concurrently.
	 */
	def proceed(fromTime: Long, toTime: Long, ctx: BioContext)

	/**
	 * Causes this bio-object to release any owned resources.
	 */
	def close()

}
